/*
 * CreatureForm.java
 *
 * Created on September 18, 2007, 11:14 AM
 */

package jia.editor.forms;

import jia.editor.EditorMain;
import jia.editor.lists.pnl_CreatureList;
import jia.game.GenericFlags;
import jia.tools.GoblinNameGenerator;
import jia.tools.OrcNameGenerator;
import jia.tools.PanelSwapper;
import org.apache.log4j.Logger;

/**
 *
 * @author  estell
 */
public class CreatureForm extends javax.swing.JPanel {
    private static final Logger log = Logger.getLogger(CreatureForm.class);
    private boolean isNew = true;
    
    /** Creates new form CreatureForm */
    public CreatureForm() {
        initComponents();
    }
    
    /**
     *Set the form fields if this form is to be used to edit an existing record.
     *While doing this, set the isNew flag to false, so the saveData method will
     *know to run an update process instead of an insert.
     */
    public void setCreatureData(){
        txt_Name.setText("Test");
//        txt_ArmorClass.setText("19");

        this.isNew = false;
        if (GenericFlags.debugMessages){
            log.debug("Creature Data Set!");
        }
        
    }
    
    /**
     *Clears out the form fields when we are done with the form
     */
    public void clearCreatureData(){
        txt_Name.setText("");
        this.isNew = true;
        if (GenericFlags.debugMessages){
            log.debug("Creature Data Cleared!");
        }
        
    }
    
    /**
     *Creates a bean object for a creature based on the values of the form.
     *When it is done, it should call the delegate and pass the bean along
     *that will ultimately write the values in the database.
     */
    public void saveCreatureData(){
        if (isNew){
            //run an insert of a new record
        }else{
            //run an update of an existing record
        }
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        pop_Abilities = new javax.swing.JPopupMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        pop_Items = new javax.swing.JPopupMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jPanel7 = new javax.swing.JPanel();
        lbl_CreatureName = new javax.swing.JLabel();
        txt_Name = new javax.swing.JTextField();
        btn_Generate = new javax.swing.JButton();
        jSplitPane2 = new javax.swing.JSplitPane();
        pnl_Details = new javax.swing.JTabbedPane();
        pnlStats = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jSpinner2 = new javax.swing.JSpinner();
        jLabel19 = new javax.swing.JLabel();
        jSpinner1 = new javax.swing.JSpinner();
        jLabel7 = new javax.swing.JLabel();
        jTextField18 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jTextField17 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField16 = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jTextField3 = new javax.swing.JTextField();
        jTextField1 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jTextField15 = new javax.swing.JTextField();
        jTextField13 = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        jTextField14 = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jTextField19 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jTextField20 = new javax.swing.JTextField();
        jTextField5 = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jTextField21 = new javax.swing.JTextField();
        jTextField7 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jTextField22 = new javax.swing.JTextField();
        jTextField6 = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jTextField23 = new javax.swing.JTextField();
        jTextField8 = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jTextField24 = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        pnl_Form = new javax.swing.JPanel();
        pnl_Immunity = new javax.swing.JPanel();
        pnl_Misc = new javax.swing.JPanel();
        pnl_SoundsSprites = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jTextField11 = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jTextField12 = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jCheckBox1 = new javax.swing.JCheckBox();
        jSpinner3 = new javax.swing.JSpinner();
        jLabel23 = new javax.swing.JLabel();
        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextPane1 = new javax.swing.JTextPane();
        jPanel8 = new javax.swing.JPanel();
        btn_Cancel = new javax.swing.JButton();
        btn_Save = new javax.swing.JButton();

        pop_Abilities.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
        pop_Abilities.setLightWeightPopupEnabled(false);

        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/add.png"))); // NOI18N
        jMenuItem1.setText("Add New Ability");
        jMenuItem1.setBorder(null);
        pop_Abilities.add(jMenuItem1);

        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/delete.png"))); // NOI18N
        jMenuItem2.setText("Delete Selected Ability");
        jMenuItem2.setBorder(null);
        pop_Abilities.add(jMenuItem2);

        pop_Items.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
        pop_Items.setLightWeightPopupEnabled(false);

        jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/add.png"))); // NOI18N
        jMenuItem3.setText("Add New Item");
        jMenuItem3.setBorder(null);
        pop_Items.add(jMenuItem3);

        jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/delete.png"))); // NOI18N
        jMenuItem4.setText("Delete Selected Item");
        jMenuItem4.setBorder(null);
        pop_Items.add(jMenuItem4);

        setMaximumSize(new java.awt.Dimension(800, 580));
        setMinimumSize(new java.awt.Dimension(800, 580));
        setPreferredSize(new java.awt.Dimension(800, 580));
        setVerifyInputWhenFocusTarget(false);
        setLayout(new java.awt.GridBagLayout());

        jPanel7.setMaximumSize(new java.awt.Dimension(780, 30));
        jPanel7.setMinimumSize(new java.awt.Dimension(780, 30));
        jPanel7.setPreferredSize(new java.awt.Dimension(780, 30));
        jPanel7.setLayout(new java.awt.GridBagLayout());

        lbl_CreatureName.setText("Creature Name");
        jPanel7.add(lbl_CreatureName, new java.awt.GridBagConstraints());

        txt_Name.setMaximumSize(new java.awt.Dimension(50, 20));
        txt_Name.setMinimumSize(new java.awt.Dimension(50, 20));
        txt_Name.setPreferredSize(new java.awt.Dimension(350, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        jPanel7.add(txt_Name, gridBagConstraints);

        btn_Generate.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/arrow_rotate_clockwise.png"))); // NOI18N
        btn_Generate.setText("Random");
        btn_Generate.setMaximumSize(new java.awt.Dimension(150, 25));
        btn_Generate.setMinimumSize(new java.awt.Dimension(150, 25));
        btn_Generate.setPreferredSize(new java.awt.Dimension(150, 25));
        btn_Generate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_GenerateActionPerformed(evt);
            }
        });
        jPanel7.add(btn_Generate, new java.awt.GridBagConstraints());

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        add(jPanel7, gridBagConstraints);

        jSplitPane2.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jSplitPane2.setDividerLocation(405);
        jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        jSplitPane2.setLastDividerLocation(405);
        jSplitPane2.setMaximumSize(new java.awt.Dimension(780, 480));
        jSplitPane2.setMinimumSize(new java.awt.Dimension(780, 480));
        jSplitPane2.setPreferredSize(new java.awt.Dimension(780, 480));

        pnl_Details.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);
        pnl_Details.setAutoscrolls(true);
        pnl_Details.setMinimumSize(new java.awt.Dimension(359, 364));
        pnl_Details.setPreferredSize(new java.awt.Dimension(798, 882));

        pnlStats.setLayout(new java.awt.GridLayout(2, 1));

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Info", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N
        jPanel6.setLayout(new java.awt.GridLayout(5, 2, 3, 3));

        jLabel2.setText("Initiaitve");
        jPanel6.add(jLabel2);

        jSpinner2.setMaximumSize(new java.awt.Dimension(65, 20));
        jSpinner2.setMinimumSize(new java.awt.Dimension(65, 20));
        jSpinner2.setPreferredSize(new java.awt.Dimension(65, 20));
        jPanel6.add(jSpinner2);

        jLabel19.setText("Challenge Rating");
        jPanel6.add(jLabel19);
        jPanel6.add(jSpinner1);

        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel7.setText("Hit Dice");
        jPanel6.add(jLabel7);
        jPanel6.add(jTextField18);

        jLabel1.setText("Size/Type");
        jPanel6.add(jLabel1);
        jPanel6.add(jTextField17);

        jLabel4.setText("XP");
        jPanel6.add(jLabel4);

        jTextField16.setMaximumSize(new java.awt.Dimension(6, 20));
        jPanel6.add(jTextField16);

        pnlStats.add(jPanel6);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Saves", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        jTextField3.setText("jTextField3");

        jTextField1.setText("jTextField1");

        jLabel3.setText("FORT");

        jLabel6.setText("REF");

        jLabel9.setText("WILL");

        jTextField2.setText("jTextField2");

        jTextField15.setText("jTextField15");

        jTextField13.setText("jTextField13");

        jLabel26.setText("Flat Footed");

        jTextField14.setText("jTextField14");

        jLabel25.setText("touch");

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .add(jLabel3)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel2Layout.createSequentialGroup()
                                .add(jTextField15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jTextField13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jLabel26)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jTextField14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jPanel2Layout.createSequentialGroup()
                                .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(6, 6, 6)
                                .add(jLabel6)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(6, 6, 6)
                                .add(jLabel9)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(61, 61, 61)
                        .add(jLabel25)))
                .addContainerGap(53, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel3)
                    .add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel6)
                    .add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel9))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jTextField15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jTextField13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel26)
                    .add(jTextField14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jLabel25)
                .addContainerGap(59, Short.MAX_VALUE))
        );

        pnlStats.add(jPanel2);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Abilities", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N
        jPanel3.setLayout(new java.awt.GridLayout(6, 3, 3, 3));

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel10.setText("Str");
        jPanel3.add(jLabel10);

        jTextField19.setMaximumSize(new java.awt.Dimension(6, 20));
        jPanel3.add(jTextField19);

        jTextField4.setEditable(false);
        jTextField4.setEnabled(false);
        jTextField4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField4ActionPerformed(evt);
            }
        });
        jPanel3.add(jTextField4);

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel11.setText("Dex");
        jPanel3.add(jLabel11);
        jPanel3.add(jTextField20);

        jTextField5.setEditable(false);
        jTextField5.setEnabled(false);
        jPanel3.add(jTextField5);

        jLabel16.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel16.setText("Int");
        jPanel3.add(jLabel16);
        jPanel3.add(jTextField21);

        jTextField7.setEditable(false);
        jTextField7.setEnabled(false);
        jPanel3.add(jTextField7);

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel15.setText("Con");
        jPanel3.add(jLabel15);
        jPanel3.add(jTextField22);

        jTextField6.setEditable(false);
        jTextField6.setEnabled(false);
        jPanel3.add(jTextField6);

        jLabel20.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel20.setText("Wis");
        jPanel3.add(jLabel20);
        jPanel3.add(jTextField23);

        jTextField8.setEditable(false);
        jTextField8.setEnabled(false);
        jPanel3.add(jTextField8);

        jLabel24.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel24.setText("Cha");
        jPanel3.add(jLabel24);
        jPanel3.add(jTextField9);

        jTextField24.setEditable(false);
        jTextField24.setEnabled(false);
        jPanel3.add(jTextField24);

        pnlStats.add(jPanel3);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Armor Class", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane4.setViewportView(jTable3);

        org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .add(jScrollPane4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 354, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .add(jScrollPane4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)
                .addContainerGap())
        );

        pnlStats.add(jPanel4);

        pnl_Details.addTab("Attributes", pnlStats);

        pnl_Form.setBorder(javax.swing.BorderFactory.createTitledBorder("Special Attacks"));

        org.jdesktop.layout.GroupLayout pnl_FormLayout = new org.jdesktop.layout.GroupLayout(pnl_Form);
        pnl_Form.setLayout(pnl_FormLayout);
        pnl_FormLayout.setHorizontalGroup(
            pnl_FormLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 761, Short.MAX_VALUE)
        );
        pnl_FormLayout.setVerticalGroup(
            pnl_FormLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 313, Short.MAX_VALUE)
        );

        pnl_Details.addTab("Special Attacks", pnl_Form);

        pnl_Immunity.setBorder(javax.swing.BorderFactory.createTitledBorder("Immunity"));

        org.jdesktop.layout.GroupLayout pnl_ImmunityLayout = new org.jdesktop.layout.GroupLayout(pnl_Immunity);
        pnl_Immunity.setLayout(pnl_ImmunityLayout);
        pnl_ImmunityLayout.setHorizontalGroup(
            pnl_ImmunityLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 761, Short.MAX_VALUE)
        );
        pnl_ImmunityLayout.setVerticalGroup(
            pnl_ImmunityLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 313, Short.MAX_VALUE)
        );

        pnl_Details.addTab("Special Qualities", pnl_Immunity);

        pnl_Misc.setBorder(javax.swing.BorderFactory.createTitledBorder("Misc"));

        org.jdesktop.layout.GroupLayout pnl_MiscLayout = new org.jdesktop.layout.GroupLayout(pnl_Misc);
        pnl_Misc.setLayout(pnl_MiscLayout);
        pnl_MiscLayout.setHorizontalGroup(
            pnl_MiscLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 761, Short.MAX_VALUE)
        );
        pnl_MiscLayout.setVerticalGroup(
            pnl_MiscLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 313, Short.MAX_VALUE)
        );

        pnl_Details.addTab("Skills", pnl_Misc);

        org.jdesktop.layout.GroupLayout pnl_SoundsSpritesLayout = new org.jdesktop.layout.GroupLayout(pnl_SoundsSprites);
        pnl_SoundsSprites.setLayout(pnl_SoundsSpritesLayout);
        pnl_SoundsSpritesLayout.setHorizontalGroup(
            pnl_SoundsSpritesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 773, Short.MAX_VALUE)
        );
        pnl_SoundsSpritesLayout.setVerticalGroup(
            pnl_SoundsSpritesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 339, Short.MAX_VALUE)
        );

        pnl_Details.addTab("Feats", pnl_SoundsSprites);

        jLabel5.setText("Base Attack/Grapple");

        jLabel17.setText("Environment");

        jTextField10.setText("jTextField10");

        jLabel18.setText("Organization");

        jTextField11.setText("jTextField11");

        jLabel21.setText("Alignment");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jTextField12.setText("jTextField12");

        jLabel22.setText("Advancement");

        jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jCheckBox1.setText("Eligible player class?");
        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox1ActionPerformed(evt);
            }
        });

        jLabel23.setText("Level Adjustment");

        org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel5Layout.createSequentialGroup()
                        .add(jLabel23)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jSpinner3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jCheckBox1))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .add(jCheckBox1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel23)
                    .add(jSpinner3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 773, Short.MAX_VALUE)
            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel1Layout.createSequentialGroup()
                    .add(304, 304, 304)
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(jPanel1Layout.createSequentialGroup()
                            .add(10, 10, 10)
                            .add(jLabel5))
                        .add(jPanel1Layout.createSequentialGroup()
                            .add(jLabel21)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jPanel1Layout.createSequentialGroup()
                            .add(jLabel18)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(jTextField11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jPanel1Layout.createSequentialGroup()
                            .add(jLabel17)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(jTextField10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jPanel1Layout.createSequentialGroup()
                            .add(jLabel22)
                            .add(57, 57, 57)
                            .add(jTextField12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(281, Short.MAX_VALUE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 672, Short.MAX_VALUE)
            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel1Layout.createSequentialGroup()
                    .add(90, 90, 90)
                    .add(jLabel5)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(jLabel17)
                        .add(jTextField10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(jLabel18)
                        .add(jTextField11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(jLabel21)
                        .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(18, 18, 18)
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(jLabel22)
                        .add(jTextField12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(2, 2, 2)
                    .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 448, Short.MAX_VALUE)
                    .add(90, 90, 90)))
        );

        pnl_Details.addTab("Treasure", jPanel1);

        jSplitPane1.setBorder(null);
        jSplitPane1.setDividerLocation(225);
        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jScrollPane2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Items"));

        jTable1.setComponentPopupMenu(pop_Items);
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable1);

        jSplitPane1.setTopComponent(jScrollPane2);

        jScrollPane3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Abilities"));

        jTable2.setComponentPopupMenu(pop_Abilities);
        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(jTable2);

        jSplitPane1.setRightComponent(jScrollPane3);

        pnl_Details.addTab("tab8", jSplitPane1);

        jSplitPane2.setTopComponent(pnl_Details);

        jTextPane1.setBackground(new java.awt.Color(0, 0, 0));
        jTextPane1.setForeground(new java.awt.Color(255, 255, 255));
        jTextPane1.setText("Creatures Screen...");
        jScrollPane1.setViewportView(jTextPane1);

        jSplitPane2.setRightComponent(jScrollPane1);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        add(jSplitPane2, gridBagConstraints);

        btn_Cancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/door_out.png"))); // NOI18N
        btn_Cancel.setText("Cancel");
        btn_Cancel.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_Cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CancelActionPerformed(evt);
            }
        });

        btn_Save.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/disk.png"))); // NOI18N
        btn_Save.setText("Save");
        btn_Save.setPreferredSize(new java.awt.Dimension(132, 30));

        org.jdesktop.layout.GroupLayout jPanel8Layout = new org.jdesktop.layout.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .add(btn_Cancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(btn_Save, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(btn_Save, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(btn_Cancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        add(jPanel8, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents
    
    private void btn_GenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_GenerateActionPerformed
        txt_Name.setText(OrcNameGenerator.generateName("male", 1));
    }//GEN-LAST:event_btn_GenerateActionPerformed
    
    private void btn_CancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CancelActionPerformed
        PanelSwapper.swap(new pnl_CreatureList(), this);
        clearCreatureData();
    }//GEN-LAST:event_btn_CancelActionPerformed

	private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
		// TODO add your handling code here:
	}//GEN-LAST:event_jCheckBox1ActionPerformed

	private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField4ActionPerformed
		// TODO add your handling code here:
	}//GEN-LAST:event_jTextField4ActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_Cancel;
    private javax.swing.JButton btn_Generate;
    private javax.swing.JButton btn_Save;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JSpinner jSpinner1;
    private javax.swing.JSpinner jSpinner2;
    private javax.swing.JSpinner jSpinner3;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JSplitPane jSplitPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField12;
    private javax.swing.JTextField jTextField13;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField15;
    private javax.swing.JTextField jTextField16;
    private javax.swing.JTextField jTextField17;
    private javax.swing.JTextField jTextField18;
    private javax.swing.JTextField jTextField19;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField20;
    private javax.swing.JTextField jTextField21;
    private javax.swing.JTextField jTextField22;
    private javax.swing.JTextField jTextField23;
    private javax.swing.JTextField jTextField24;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JTextPane jTextPane1;
    private javax.swing.JLabel lbl_CreatureName;
    private javax.swing.JPanel pnlStats;
    private javax.swing.JTabbedPane pnl_Details;
    private javax.swing.JPanel pnl_Form;
    private javax.swing.JPanel pnl_Immunity;
    private javax.swing.JPanel pnl_Misc;
    private javax.swing.JPanel pnl_SoundsSprites;
    private javax.swing.JPopupMenu pop_Abilities;
    private javax.swing.JPopupMenu pop_Items;
    private javax.swing.JTextField txt_Name;
    // End of variables declaration//GEN-END:variables
    
}
